1. Technology Field
The present invention relates to a block management and replacement method for a flash memory, and a flash memory storage system and a controller using the same. More particularly, the present invention relates to a block management and replacement method for a flash memory chip having multi block planes, and a flash memory storage system and a controller using the same.
2. Description of Related Art
With a quick developing of digital camera, cell phone camera and MP3, demand of storage media by customers is increased greatly. Since a flash memory has the advantages of non-volatile, energy saving, small size and none mechanical structure etc., it is suitable for portable applications, and especially for portable battery-powered products. A solid state drive is a storage device applying an NAND flash memory as a storage medium thereof.
Generally, a flash memory die within a flash memory chip of the flash memory storage system is divided into a plurality of physical units, and the physical units are generally consisted of a physical block or a plurality of physical blocks. The physical units are generally grouped into a data area and a spare area. The physical units grouped in the data area can store valid data written according to a writing command, and the physical units grouped in the spare area are used for replacing the physical units of the data area during execution of the writing command. To be specific, when the flash memory storage system receives the writing command from a host to perform writing to the physical units of the data area, the flash memory storage system selects the physical units from the spare area, and writes old valid data stored in the physical units to be updated within the data area and new data to be written into the physical units selected from the spare area, and then associates the physical units written with the new data to the data area, and erases the original physical units of the data area and associates it to the spare area. For the host to smoothly access the physical units storing data in an alternate approach, logical units are configured to the flash memory storage system for being provided to the host to access, wherein the logical units are configured in a size of one or a plurality of physical blocks according to the physical units. Namely, the flash memory storage system can establish a logical-physical address mapping table, in which a mapping relation of the logical units and the physical units of the data area are recorded and updated for reflecting alternation of the physical units, so that the host can only perform the accessing based on the provided logical units, and accordingly the flash memory storage system can read data from or write data into the mapped physical units according to the logical-physical address mapping table.
Moreover, a part of the physical units is maintained in a general flash memory chip to serve as a replacement area, which is used for replacing damaged physical units when the physical units of the data area or the spare area are damaged. Particularly, to improve an accessing speed of the flash memory chip having multi block planes, the physical unit formed by a plurality of physical blocks that is belonged to different block planes and suitable for executing multi-planes accessing commands is generally used for performing the accessing. In this case, if one of the physical block in the physical unit is damaged, the flash memory storage system can replace the physical unit having the damaged physical block in a unit of a whole physical unit, so that data accessing thereof can still be performed according to the multi-planes accessing mode. Such a replacement operation can be executed until there is no available physical unit can be used for replacing the damaged physical unit, and now the flash memory storage system is regarded as useless and cannot be used any more.
However, the replaced damaged physical unit actually still has undamaged physical blocks, so that the aforementioned block management and replacement method can cause a waste of storage space of the flash memory storage system, and accordingly lifespan of the flash memory storage system is shortened.